<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!--      <el-form-item label="空间名称" prop="buildName">
        <el-input
          v-model="queryParams.buildName"
          placeholder="请输入空间名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="产业集群" prop="parkIndustry">
        <el-select v-model="queryParams.parkIndustry"  placeholder="请选择产业集群" clearable>
          <el-option
            v-for="dict in dict.type.industry_orientation"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="所属城市" prop="cityId"><!--todo:省市二级联查-->
        <el-select v-model="queryParams.provinceId" placeholder="请选择省份"
                   @change="getCityList(queryParams.provinceId)"
                   style="width: 108px"
                   clearable>
          <el-option
            v-for="dict in provinces"
            :key="dict.id"
            :label="dict.name"
            :value="dict.id"
          />
        </el-select>
        <el-select v-model="queryParams.cityId" placeholder="请选择城市"
                   :disabled="queryParams.provinceId==null||queryParams.provinceId===''"
                   style="width: 107px"
                   clearable>
          <el-option
            v-for="dict in citys"
            :key="dict.id"
            :label="dict.name"
            :value="dict.id"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="园区类型" prop="parkType">
        <el-select v-model="queryParams.parkType" placeholder="请选择园区类型" clearable>
          <el-option
            v-for="dict in dict.type.park_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="经济带" prop="parkEconomic">
        <el-select v-model="queryParams.parkEconomic" placeholder="请选择经济带" clearable>
          <el-option
            v-for="dict in dict.type.economic_belt"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>-->
      <el-form-item label="需求类型" prop="supplyType">
        <el-select v-model="queryParams.supplyType" placeholder="请选择需求类型" clearable>
          <el-option
            v-for="dict in dict.type.need_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="预算" prop="buildLeasePrice">
        <el-select v-model="queryParams.buildLeasePrice" placeholder="请选择预算" clearable>
          <el-option
            v-for="dict in dict.type.rental_price"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="预期价格" prop="buildSellPrice">
        <el-select v-model="queryParams.buildSellPrice" placeholder="请选择预期价格" clearable>
          <el-option
            v-for="dict in dict.type.selling_price"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="总面积" prop="buildAllSize">
        <el-input
          v-model="queryParams.buildAllSize"
          placeholder="请输入总面积"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="空置面积" prop="buildFreeSize">
        <el-input
          v-model="queryParams.buildFreeSize"
          placeholder="请输入空置面积"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区楼号" prop="buildNumber">
        <el-input
          v-model="queryParams.buildNumber"
          placeholder="请输入园区楼号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装修程度" prop="buildRenova">
        <el-select v-model="queryParams.buildRenova" placeholder="请选择装修程度" clearable>
          <el-option
            v-for="dict in dict.type.degree_of_decoration"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>-->
      <el-form-item label="层高" prop="buildFloorHeight">
        <el-select v-model="queryParams.buildFloorHeight" placeholder="请选择空间层高" clearable>
          <el-option
            v-for="dict in dict.type.floor_height"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="空间所在楼层" prop="buildPlaceFloor">
        <el-input
          v-model="queryParams.buildPlaceFloor"
          placeholder="请输入空间所在楼层"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="首层承重" prop="buildFirstLoad">
        <el-input
          v-model="queryParams.buildFirstLoad"
          placeholder="请输入首层承重"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标准层承重" prop="buildLoad">
        <el-input
          v-model="queryParams.buildLoad"
          placeholder="请输入标准层承重"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客梯" prop="buildElevatorPeople">
        <el-select v-model="queryParams.buildElevatorPeople" placeholder="请选择客梯" clearable>
          <el-option
            v-for="dict in dict.type.sys_have_not"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="客梯负载" prop="buildElevatorPeopleLoad">
        <el-input
          v-model="queryParams.buildElevatorPeopleLoad"
          placeholder="请输入客梯负载"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货梯" prop="buildElevatorCargo">
        <el-select v-model="queryParams.buildElevatorCargo" placeholder="请选择货梯" clearable>
          <el-option
            v-for="dict in dict.type.sys_have_not"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="货梯负载" prop="buildElevatorCargoLoad">
        <el-input
          v-model="queryParams.buildElevatorCargoLoad"
          placeholder="请输入货梯负载"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="应急系统" prop="buildEmergency">
        <el-select v-model="queryParams.buildEmergency" placeholder="请选择应急系统" clearable>
          <el-option
            v-for="dict in dict.type.sys_have_not"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="供暖" prop="buildHeating">
        <el-select v-model="queryParams.buildHeating" placeholder="请选择供暖" clearable>
          <el-option
            v-for="dict in dict.type.heating_system"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="制冷" prop="buildRefrig">
        <el-select v-model="queryParams.buildRefrig" placeholder="请选择制冷" clearable>
          <el-option
            v-for="dict in dict.type.refrigerating_system"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!--todo：燃气，字典查询-->
      <el-form-item label="燃气" prop="buildRefrig">
        <el-select v-model="queryParams.buildRefrig" placeholder="请选择燃气" clearable>
          <el-option
            v-for="dict in dict.type.refrigerating_system"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="审核状态" prop="approvalState">
        <el-select v-model="queryParams.approvalState" placeholder="请选择审核状态" clearable>
          <el-option
            v-for="dict in dict.type.audit_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="新风系统" prop="buildNather">
        <el-select v-model="queryParams.buildNather" placeholder="请选择新风系统" clearable>
          <el-option
            v-for="dict in dict.type.sys_have_not"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="电量" prop="buildPower">
        <el-input
          v-model="queryParams.buildPower"
          placeholder="请输入电量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="水" prop="buildWater">
        <el-select v-model="queryParams.buildWater" placeholder="请选择水" clearable>
          <el-option
            v-for="dict in dict.type.water_system"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="园区公寓" prop="buildApartment">
        <el-input
          v-model="queryParams.buildApartment"
          placeholder="请输入园区公寓"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核状态：0待审核1审核通过2审核失败" prop="approvalState">
        <el-input
          v-model="queryParams.approvalState"
          placeholder="请输入审核状态：0待审核1审核通过2审核失败"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="区域位置" prop="parkAreaAddress">
        <el-input
          v-model="queryParams.parkAreaAddress"
          placeholder="请输入区域位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商圈" prop="parkDistrict">
        <el-input
          v-model="queryParams.parkDistrict"
          placeholder="请输入商圈"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区车位" prop="parkCarlot">
        <el-input
          v-model="queryParams.parkCarlot"
          placeholder="请输入园区车位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区产业定位" prop="parkIndustry" label-width="96px">
        <el-input
          v-model="queryParams.parkIndustry"
          placeholder="请输入园区产业定位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="办公家具" prop="buildFurniture">
        <el-input
          v-model="queryParams.buildFurniture"
          placeholder="请输入办公家具"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专用物流通道" prop="parkLogistics">
        <el-input
          v-model="queryParams.parkLogistics"
          placeholder="请输入专用物流通道"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区餐饮" prop="parkRestaurant">
        <el-input
          v-model="queryParams.parkRestaurant"
          placeholder="请输入园区餐饮"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公交" prop="parkBus">
        <el-input
          v-model="queryParams.parkBus"
          placeholder="请输入公交"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="地铁" prop="parkMetro">
        <el-input
          v-model="queryParams.parkMetro"
          placeholder="请输入地铁"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="需求面积" prop="buildNeedSize">
        <el-input
          v-model="queryParams.buildNeedSize"
          placeholder="请输入需求面积"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审核备注" prop="approvalNote">
        <el-input
          v-model="queryParams.approvalNote"
          placeholder="请输入审核备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区ID" prop="parkId">
        <el-input
          v-model="queryParams.parkId"
          placeholder="请输入园区ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所属城市ID" prop="cityId" label-width="96px">
        <el-input
          v-model="queryParams.cityId"
          placeholder="请输入所属城市ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="浏览量" prop="pageView">
        <el-input
          v-model="queryParams.pageView"
          placeholder="请输入浏览量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否收藏0否1是" prop="collectState">
        <el-input
          v-model="queryParams.collectState"
          placeholder="请输入是否收藏0否1是"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否明星推荐0否1是" prop="recState">
        <el-input
          v-model="queryParams.recState"
          placeholder="请输入是否明星推荐0否1是"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="预定状态0未预定1已预定" prop="reserveState">
        <el-input
          v-model="queryParams.reserveState"
          placeholder="请输入预定状态0未预定1已预定"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="明星推荐状态0否1是" prop="recomState">
        <el-input
          v-model="queryParams.recomState"
          placeholder="请输入明星推荐状态0否1是"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系人" prop="contactName">
        <el-input
          v-model="queryParams.contactName"
          placeholder="请输入联系人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="servicePhone">
        <el-input
          v-model="queryParams.servicePhone"
          placeholder="请输入联系方式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="contactPhone">
        <el-input
          v-model="queryParams.contactPhone"
          placeholder="请输入联系方式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发布人用户ID" prop="supplyUserId">
        <el-input
          v-model="queryParams.supplyUserId"
          placeholder="请输入发布人用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="note">
        <el-input
          v-model="queryParams.note"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="排序" prop="sort">
        <el-input
          v-model="queryParams.sort"
          placeholder="请输入排序"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态0有效1失效" prop="state">
        <el-input
          v-model="queryParams.state"
          placeholder="请输入状态0有效1失效"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否删除0否1是" prop="dr">
        <el-input
          v-model="queryParams.dr"
          placeholder="请输入是否删除0否1是"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="置顶" prop="top">
        <el-input
          v-model="queryParams.top"
          placeholder="请输入置顶"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区经度" prop="parkLongitude">
        <el-input
          v-model="queryParams.parkLongitude"
          placeholder="请输入园区经度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区维度" prop="parkLatitude">
        <el-input
          v-model="queryParams.parkLatitude"
          placeholder="请输入园区维度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['myIndustry:building:add']"
        >新增</el-button>
      </el-col>
<!--      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['myIndustry:building:edit']"
        >修改</el-button>
      </el-col>
      -->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['myIndustry:building:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['myIndustry:building:export']"
        >导出
        </el-button>
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="warning"-->
<!--          plain-->
<!--          icon="el-icon-download"-->
<!--          size="mini"-->
<!--          @click="handleExport"-->
<!--          v-hasPermi="['myIndustry:building:export']"-->
<!--        >导出</el-button>-->
<!--      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange" height="410" fixed>
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="id" />
      <el-table-column label="建筑类型" align="center" prop="buildType" >
        <template slot-scope="scope">
          <dict-tag :options="dict.type.space_type" :value="scope.row.buildType"/>
        </template>
      </el-table-column>
      <el-table-column label="空间名称" align="center" prop="buildName" />
      <el-table-column label="需求类型" align="center" prop="supplyType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.need_mode" :value="scope.row.supplyType ? scope.row.supplyType.split(',') : []"/>
        </template>
      </el-table-column>
<!--      <el-table-column label="关联园区" align="center" prop="parkName" />-->
      <el-table-column label="关联园区" align="center" prop="parkName" />
      <el-table-column label="所属城市" align="center" prop="cityName" />
<!--      <el-table-column label="微信二维码" align="center" prop="qrCode" />-->
      <el-table-column label="发布类型" align="center" prop="releaseType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.announce_type" :value="scope.row.releaseType"/>
        </template>
      </el-table-column>
      <el-table-column label="联系人" align="center" prop="contactName"/>
      <el-table-column label="联系方式" align="center" prop="contactPhone"/>
<!--      <el-table-column label="VR资源" align="center" prop="vrResource" />
      <el-table-column label="图片资源" align="center" prop="imgResource" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.imgResource" :width="50" :height="50"/>
        </template>
      </el-table-column>-->
<!--      <el-table-column label="客服联系方式" align="center" prop="servicePhone" width="120"/>-->
<!--      <el-table-column label="发布用户" align="center" prop="supplyUserId"/>-->
      <el-table-column label="审核状态" align="center" prop="approvalState">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.audit_status" :value="scope.row.approvalState"/>
        </template>
      </el-table-column>
      <!--      <el-table-column label="预算" align="center" prop="buildLeasePrice" />-->
<!--      <el-table-column label="预期价格" align="center" prop="buildSellPrice" />-->
      <el-table-column label="建筑面积" align="center" prop="buildAllSize" />
      <el-table-column label="空置面积" align="center" prop="buildFreeSize" />
<!--      <el-table-column label="园区楼号" align="center" prop="buildNumber" />
      <el-table-column label="装修程度" align="center" prop="buildRenova">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.degree_of_decoration" :value="scope.row.buildRenova"/>
        </template>
      </el-table-column>
      <el-table-column label="空间层高" align="center" prop="buildFloorHeight">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.floor_height" :value="scope.row.buildFloorHeight"/>
        </template>
      </el-table-column>
      <el-table-column label="空间所在楼层" align="center" prop="buildPlaceFloor" />
      <el-table-column label="首层承重" align="center" prop="buildFirstLoad" />
      <el-table-column label="标准层承重" align="center" prop="buildLoad" />
      <el-table-column label="客梯" align="center" prop="buildElevatorPeople">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_have_not" :value="scope.row.buildElevatorPeople"/>
        </template>
      </el-table-column>
      <el-table-column label="客梯负载" align="center" prop="buildElevatorPeopleLoad" />
      <el-table-column label="货梯" align="center" prop="buildElevatorCargo">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_have_not" :value="scope.row.buildElevatorCargo"/>
        </template>
      </el-table-column>
      <el-table-column label="货梯负载" align="center" prop="buildElevatorCargoLoad" />
      <el-table-column label="消防设施" align="center" prop="buildFireControl">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.fire_fighting_device" :value="scope.row.buildFireControl ? scope.row.buildFireControl.split(',') : []"/>
        </template>
      </el-table-column>
      <el-table-column label="应急系统" align="center" prop="buildEmergency">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_have_not" :value="scope.row.buildEmergency"/>
        </template>
      </el-table-column>
      <el-table-column label="供暖" align="center" prop="buildHeating">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.heating_system" :value="scope.row.buildHeating"/>
        </template>
      </el-table-column>
      <el-table-column label="制冷" align="center" prop="buildRefrig">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.refrigerating_system" :value="scope.row.buildRefrig"/>
        </template>
      </el-table-column>
      <el-table-column label="新风系统" align="center" prop="buildNather">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_have_not" :value="scope.row.buildNather"/>
        </template>
      </el-table-column>
      <el-table-column label="电量" align="center" prop="buildPower" />
      <el-table-column label="燃气" align="center" prop="buildGas">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.gas_system" :value="scope.row.buildGas ? scope.row.buildGas.split(',') : []"/>
        </template>
      </el-table-column>
      <el-table-column label="水" align="center" prop="buildWater">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.water_system" :value="scope.row.buildWater"/>
        </template>
      </el-table-column>
      <el-table-column label="园区公寓" align="center" prop="buildApartment" />

      <el-table-column label="招租要求" align="center" prop="letRequire" />
      <el-table-column label="园区类别" align="center" prop="parkType" />
      <el-table-column label="区域位置" align="center" prop="parkAreaAddress" />
      <el-table-column label="商圈" align="center" prop="parkDistrict" />
      <el-table-column label="园区车位" align="center" prop="parkCarlot" />
      <el-table-column label="园区产业定位" align="center" prop="parkIndustry" />
      <el-table-column label="办公家具" align="center" prop="buildFurniture" />
      <el-table-column label="专用物流通道" align="center" prop="parkLogistics" />
      <el-table-column label="园区餐饮" align="center" prop="parkRestaurant" />
      <el-table-column label="公交" align="center" prop="parkBus" />
      <el-table-column label="地铁" align="center" prop="parkMetro" />
      <el-table-column label="需求面积" align="center" prop="buildNeedSize" />
      <el-table-column label="审核备注" align="center" prop="approvalNote" />
      <el-table-column label="园区ID" align="center" prop="parkId" />
      <el-table-column label="所属城市ID" align="center" prop="cityId" />
      <el-table-column label="发布类型0供给1需求" align="center" prop="releaseType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.announce_type" :value="scope.row.approvalState"/>
        </template>
      </el-table-column>
      <el-table-column label="浏览量" align="center" prop="pageView" />
      <el-table-column label="是否收藏0否1是" align="center" prop="collectState" />
      <el-table-column label="是否明星推荐0否1是" align="center" prop="recState" />
      <el-table-column label="预定状态0未预定1已预定" align="center" prop="reserveState" />
      <el-table-column label="明星推荐状态0否1是" align="center" prop="recomState" />
      <el-table-column label="封面资源http:p1" align="center" prop="coverResource" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.coverResource" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="note" />
      <el-table-column label="排序" align="center" prop="sort" />
      <el-table-column label="状态0有效1失效" align="center" prop="state" />
      <el-table-column label="是否删除0否1是" align="center" prop="dr" />
      <el-table-column label="VR封面" align="center" prop="vrcover" />
      <el-table-column label="置顶" align="center" prop="top" />
      <el-table-column label="${comment}" align="center" prop="buildIntro" />
      <el-table-column label="${comment}" align="center" prop="buildAround" />
      <el-table-column label="园区经度" align="center" prop="parkLongitude" />
      <el-table-column label="园区维度" align="center" prop="parkLatitude" />-->
      <el-table-column width="220" fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-row align="center">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click="handleLook(scope.row)"
            >预览
            </el-button>
              <el-button
                style=""
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['myIndustry:building:edit']"
              >修改</el-button>
<!--            <el-col :span="13">-->
<!--              <el-button-->
<!--                style="color: #ffba00"-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-edit"-->
<!--                @click="spaceAudit(scope.row)"-->
<!--                v-hasPermi="['myIndustry:building:edit']"-->
<!--              >审核</el-button>-->
<!--            </el-col>-->

<!--            <el-col :span="13">-->
<!--              <el-button-->
<!--                style="color: #00afff"-->
<!--                size="mini"-->
<!--                type="text"-->
<!--                icon="el-icon-edit"-->
<!--                @click="handleUpdate(scope.row)"-->
<!--                v-hasPermi="['myIndustry:building:edit']"-->
<!--              >委托</el-button>-->
<!--            </el-col>-->
              <el-button
                style=""
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['myIndustry:building:remove']"
              >删除</el-button>
<!--            <el-col :span="1.5">-->
<!--              <el-button-->
<!--                type="warning"-->
<!--                plain-->
<!--                icon="el-icon-download"-->
<!--                size="mini"-->
<!--                @click="handleExport"-->
<!--                v-hasPermi="['myIndustry:building:export']"-->
<!--              >导出-->
<!--              </el-button>-->
<!--            </el-col>-->
          </el-row>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改楼宇商用对话框 -->
    <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="759px" append-to-body center>
      <el-form ref="form" :model="form" :rules="rules" label-width="130px" style="margin-left: 2%; margin-right: 2%">
        <el-form-item label="空间名称" prop="buildName" >
          <el-input v-model="form.buildName" placeholder="请输入空间名称" style="width: 100%" maxlength="50"/>
        </el-form-item>
        <el-row>
          <el-col :span="24">
            <el-form-item label="需求类型" prop="supplyType">
              <el-checkbox-group v-model="form.supplyType" style="width: 100%">
                <el-checkbox
                    v-for="dict in dict.type.need_mode"
                    :key="dict.value"
                    :label="dict.value">
                  {{ dict.label }}
                </el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
<!--          <el-col :span="24">-->
<!--            <el-form-item label="发布类型" prop="releaseType">-->
<!--              <el-select v-model="form.releaseType" placeholder="请选择发布类型" style="width: 100%">-->
<!--                <el-option-->
<!--                    v-for="dict in dict.type.announce_type"-->
<!--                    :key="dict.value"-->
<!--                    :label="dict.label"-->
<!--                    :value="dict.value"-->
<!--                ></el-option>-->
<!--              </el-select>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="预算" prop="buildLeasePrice">
              <el-input v-model="form.buildLeasePrice" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入预算">
                <template slot="append">元/m²/天</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="预期价格" prop="buildSellPrice">
              <el-input v-model="form.buildSellPrice" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入预期价格">
                <template slot="append">元/m²</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="期望地段" prop="parkAreaAddress">
          <el-select v-model="form.parkAreaAddress" placeholder="请选择期望地段" style="width: 100%">
            <el-option
              v-for="dict in dict.type.regional_position"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-row>
          <el-col :span="24">
            <el-form-item label="建筑总面积" prop="buildAllSize">
              <el-input v-model="form.buildAllSize" oninput ="value=value.replace(/[^0-9.]/g,'')" @change="handleAcreage" maxlength="50" placeholder="请输入总面积">
                <template slot="append">m²</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="空置面积" prop="buildFreeSize">
              <el-input v-model="form.buildFreeSize" oninput ="value=value.replace(/[^0-9.]/g,'')" @change="handleAcreage" maxlength="50" placeholder="请输入空置面积">
                <template slot="append">m²</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="需求面积" prop="buildNeedSize">
              <el-input v-model="form.buildNeedSize" maxlength="100" @change="handleAcreage" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入需求面积">
                <template slot="append">m²</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item>
              <el-alert
                class="park" title="空置面积大于总面积" v-if="acreage<0" :closable="false" type="error" center show-icon>
              </el-alert>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="楼宇楼号" prop="buildNumber">
              <el-input v-model="form.buildNumber" placeholder="请输入园区楼号" maxlength="50"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="装修程度" prop="buildRenova">
              <el-select v-model="form.buildRenova" placeholder="请选择装修程度" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.degree_of_decoration"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="首层层高" prop="buildFloorHeight">
              <el-select v-model="form.buildFloorHeight" placeholder="请选择层高" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.floor_height"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="空间所在楼层" prop="buildPlaceFloor">
              <el-input v-model="form.buildPlaceFloor" placeholder="请输入空间所在楼层" maxlength="50"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="首层承重" prop="buildFirstLoad">
              <el-input v-model="form.buildFirstLoad" placeholder="请输入首层承重" maxlength="50">
                <template slot="append">kg</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="标准层承重" prop="buildLoad">
              <el-input v-model="form.buildLoad" placeholder="请输入标准层承重" maxlength="50">
                <template slot="append">kg</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="客梯" prop="buildElevatorPeople">
              <el-radio-group v-model="form.buildElevatorPeople">
                <el-radio :label="'有-'">
                  有
                  <input class="sq" style="width: 50px" oninput ="value=value.replace(/[^0-9]/g,'')" v-model="otherElevatorPeople" />
                  部
                </el-radio>
                <el-radio label="无">无</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="客梯负载" prop="buildElevatorPeopleLoad">
              <el-input v-model="form.buildElevatorPeopleLoad" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入客梯负载">
                <template slot="append">kg</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="货梯" prop="buildElevatorCargo">
              <el-radio-group v-model="form.buildElevatorCargo">
                <el-radio :label="'有-'">
                  有
                  <input class="sq" style="width: 50px"
                         oninput ="value=value.replace(/[^0-9]/g,'')"
                         v-model="otherElevatorCargo" />
                  部
                </el-radio>
                <el-radio label="无">无</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="货梯负载" prop="buildElevatorCargoLoad">
              <el-input v-model="form.buildElevatorCargoLoad"  maxlength="50" oninput ="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入货梯负载">
                <template slot="append">kg</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="消防设施" prop="buildFireControl">
              <el-checkbox-group v-model="form.buildFireControl">
                <el-checkbox
                    v-for="dict in dict.type.fire_fighting_device"
                    :key="dict.value"
                    :label="dict.value">
                  {{ dict.label }}
                </el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="应急系统" prop="buildEmergency">
              <el-radio-group v-model="form.buildEmergency">
                <el-radio
                    v-for="dict in dict.type.sys_have_not"
                    :key="dict.value"
                    :label="dict.value"
                >{{ dict.label }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="供暖" prop="buildHeating">
              <el-select v-model="form.buildHeating" placeholder="请选择供暖" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.heating_system"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="供暖费" prop="heatingRate">
              <el-input v-model="form.heatingRate" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入供暖价格" style="width: 100%">
                <template slot="append">元/月</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="制冷" prop="buildRefrig">
              <el-select v-model="form.buildRefrig"  placeholder="请选择制冷" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.refrigerating_system"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="制冷费用" prop="refrigRate">
              <el-input v-model="form.refrigRate" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入制冷价格" style="width: 100%">
                <template slot="append">元/月</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="电量" prop="buildPower">
              <el-input v-model="form.buildPower" placeholder="请输入电量" style="width: 100%" maxlength="50">
                <template slot="append">度</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="电费" prop="powerRate">
              <el-input v-model="form.powerRate" oninput ="value=value.replace(/[^0-9.]/g,'')"  maxlength="50"placeholder="请输入电费" style="width: 100%">
                <template slot="append">元/度</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="供水" prop="buildWater">
              <el-select v-model="form.buildWater" placeholder="请选择供水" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.water_system"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="水费" prop="waterRate">
              <el-input v-model="form.waterRate" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入水费" style="width: 100%">
                <template slot="append">元/m³</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="新风系统" prop="buildNather">
              <el-select v-model="form.buildNather" placeholder="请选择新风系统" style="width: 100%">
                <el-option
                    v-for="dict in dict.type.sys_have_not"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="物业费用" prop="propertyFee">
              <el-input v-model="form.propertyFee" oninput ="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入物业费价格" style="width: 100%">
                <template slot="append">元/年</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="燃气" prop="buildGas" style="width: 100%">
              <el-radio-group v-model="form.buildGas">
                <el-radio
                  v-for="dict in dict.type.gas_system"
                  :key="dict.value"
                  :label="dict.value"
                >{{ dict.label }}
                </el-radio>
              </el-radio-group>
              <input v-if="form.buildGas==='其他-'" class="sq" v-model="otherGas" style="width: 20%"
                     placeholder="请输入其他燃气类型"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="燃气费用" prop="gasRate">
              <el-input v-model="form.gasRate" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="50" placeholder="请输入燃气价格"
                        style="width: 100%">
                <template slot="append">元/m³</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="关联园区" prop="parkId">
              <el-select v-model="form.parkId" filterable remote placeholder="请输入关联园区"
                         style="width: 100%">
                <el-option v-for="dict in parkList" :key="dict.id"
                           :label="dict.parkName" :value="dict.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="园区公寓" prop="buildApartment">
              <!--              <el-input v-model="form.buildApartment" style="width: 100%" placeholder="请输入园区公寓"/>-->
              <el-checkbox-group v-model="form.buildApartment">
                <el-checkbox
                  v-for="dict in dict.type.park_apartment"
                  :key="dict.value"
                  :label="dict.value">
                  {{ dict.label }}
                </el-checkbox>
              </el-checkbox-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="所属城市" prop="cityName">
              <el-select v-model="form.provinceId" placeholder="请选择省份" style="width: 50%"
                         @change="getCityList(form.provinceId)" clearable>
                <el-option
                    v-for="dict in provinces"
                    :key="dict.id"
                    :label="dict.name"
                    :value="dict.id"
                />
              </el-select>
              <el-select v-model="form.cityId" placeholder="请选择城市"
                         :disabled="form.provinceId==null||form.provinceId===''"
                         style="width: 50%" clearable>
                <el-option
                    v-for="dict in citys"
                    :key="dict.id"
                    :label="dict.name"
                    :value="dict.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
<!--          <el-col :span="24">
            &lt;!&ndash;        dddd&ndash;&gt;
            <el-form-item label="热门推荐" prop="recomState">
&lt;!&ndash;              <el-input v-model="form.recState" style="width: 100%" placeholder="请输入是否热门推荐（1:是,0：否）"/>&ndash;&gt;
              <el-select v-model="form.recomState" placeholder="请选择是否热门推荐" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.recommend"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="明星推荐" prop="recState">
&lt;!&ndash;              <el-input v-model="form.recomState" style="width: 100%" placeholder="请输入是否明星推荐（1:是,0：否）"/>&ndash;&gt;
              <el-select v-model="form.recState" placeholder="请选择是否明星推荐" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.recommend"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="置顶" prop="top">
&lt;!&ndash;              <el-input v-model="form.top" style="width: 100%" placeholder="请输入是否置顶（1:是,0：否）"/>&ndash;&gt;
              <el-select v-model="form.top" placeholder="请选择是否置顶" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.sys_whether"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>-->
        </el-row>
        <el-form-item label="楼宇介绍" prop="buildIntro">
<!--          <el-input v-model="form.buildIntro" type="textarea" placeholder="请输入内容" />-->
          <my-editor v-model="form.buildIntro" :min-height="100"/>
        </el-form-item>
        <el-form-item label="楼宇周边情况" prop="buildAround">
          <el-input v-model="form.buildAround" type="textarea" maxlength="2000" show-word-limit placeholder="请输入内容" />
        </el-form-item>
<!--        <el-form-item label="经度" prop="parkLongitude">-->
<!--          <el-input v-model="form.parkLongitude" placeholder="请输入园区经度" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="维度" prop="parkLatitude">-->
<!--          <el-input v-model="form.parkLatitude" placeholder="请输入园区维度" />-->
<!--        </el-form-item>-->
        <el-form-item label="VR封面" prop="vrcover">
          <!--          <file-upload v-model="form.vrcover"/>-->
          <image-upload v-model="form.vrcover" :limit="1"/>
        </el-form-item>
        <el-form-item label="VR资源" prop="vrResource">
<!--          <file-upload v-model="form.vrResource"/>-->
          <video-upload v-model="form.vrResource"/>
        </el-form-item>
        <el-form-item label="图片资源" prop="imgResource">
          <image-upload v-model="form.imgResource"/>
        </el-form-item>
        <el-form-item label="封面资源" prop="coverResource">
          <image-upload v-model="form.coverResource" :limit="1"/>
        </el-form-item>
        <el-form-item label="微信二维码" prop="qrCode">
          <image-upload v-model="form.qrCode" :limit="1"/>
        </el-form-item>

        <el-row>
          <el-col :span="24">
            <el-form-item label="联系人" prop="contactName">
              <el-input v-model="form.contactName" style="width: 100%" placeholder="请输入联系人" maxlength="50"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="联系方式" prop="contactPhone">
              <el-input v-model="form.contactPhone" style="width: 100%" placeholder="请输入联系方式" maxlength="50"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="备注" prop="note">
          <el-input v-model="form.note" type="textarea" maxlength="100" show-word-limit placeholder="请输入备注" />
        </el-form-item>
        <el-form-item >
          <el-alert
            title="初审通过" type="success" center :closable="false" v-if="form.approvalState===1||form.approvalState===3||form.approvalState===4"  show-icon>
          </el-alert>
          <el-alert
            title="初审拒绝" type="error" center :closable="false" v-if="form.approvalState===2"  show-icon>
          </el-alert>
        </el-form-item>
        <el-form-item label="初审意见" prop="approvalNote" v-if="form.approvalState!==0&&form.approvalState!=null">
          <editor v-model="form.approvalNote" :min-height="100"  read-only/>
        </el-form-item>
        <el-form-item>
          <el-alert title="复审通过" type="success" center :closable="false" v-if="form.approvalState===1"  show-icon>
          </el-alert>
          <el-alert title="复审拒绝" type="error" center :closable="false" v-if="form.approvalState===4"  show-icon>
          </el-alert>
        </el-form-item>
        <el-form-item label="复审意见" prop="recheckNote" v-if="form.approvalState===1||form.approvalState===4">
          <editor v-model="form.recheckNote" :min-height="100"  read-only/>
        </el-form-item>
<!--        <el-form-item label="审核状态：0待审核1审核通过2审核失败" prop="approvalState">
          <el-input v-model="form.approvalState" placeholder="请输入审核状态：0待审核1审核通过2审核失败" />
        </el-form-item>
        <el-form-item label="招租要求" prop="letRequire">
          <el-input v-model="form.letRequire" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="区域位置" prop="parkAreaAddress">
          <el-input v-model="form.parkAreaAddress" placeholder="请输入区域位置" />
        </el-form-item>
        <el-form-item label="商圈" prop="parkDistrict">
          <el-input v-model="form.parkDistrict" placeholder="请输入商圈" />
        </el-form-item>
        <el-form-item label="园区车位" prop="parkCarlot">
          <el-input v-model="form.parkCarlot" placeholder="请输入园区车位" />
        </el-form-item>
        <el-form-item label="园区产业定位" prop="parkIndustry">
          <el-input v-model="form.parkIndustry" placeholder="请输入园区产业定位" />
        </el-form-item>
        <el-form-item label="办公家具" prop="buildFurniture">
          <el-input v-model="form.buildFurniture" placeholder="请输入办公家具" />
        </el-form-item>
        <el-form-item label="专用物流通道" prop="parkLogistics">
          <el-input v-model="form.parkLogistics" placeholder="请输入专用物流通道" />
        </el-form-item>
        <el-form-item label="园区餐饮" prop="parkRestaurant">
          <el-input v-model="form.parkRestaurant" placeholder="请输入园区餐饮" />
        </el-form-item>
        <el-form-item label="公交" prop="parkBus">
          <el-input v-model="form.parkBus" placeholder="请输入公交" />
        </el-form-item>
        <el-form-item label="地铁" prop="parkMetro">
          <el-input v-model="form.parkMetro" placeholder="请输入地铁" />
        </el-form-item>
        <el-form-item label="需求面积" prop="buildNeedSize">
          <el-input v-model="form.buildNeedSize" placeholder="请输入需求面积" />
        </el-form-item>
        <el-form-item label="浏览量" prop="pageView">
          <el-input v-model="form.pageView" placeholder="请输入浏览量" />
        </el-form-item>
        <el-form-item label="是否收藏0否1是" prop="collectState">
          <el-input v-model="form.collectState" placeholder="请输入是否收藏0否1是" />
        </el-form-item>
        <el-form-item label="是否明星推荐0否1是" prop="recState">
          <el-input v-model="form.recState" placeholder="请输入是否明星推荐0否1是" />
        </el-form-item>
        <el-form-item label="预定状态0未预定1已预定" prop="reserveState">
          <el-input v-model="form.reserveState" placeholder="请输入预定状态0未预定1已预定" />
        </el-form-item>

        <el-form-item label="发布人用户ID" prop="supplyUserId">
          <el-input v-model="form.supplyUserId" placeholder="请输入发布人用户ID" />
        </el-form-item>
        <el-form-item label="排序" prop="sort">
          <el-input v-model="form.sort" placeholder="请输入排序" />
        </el-form-item>
        <el-form-item label="状态0有效1失效" prop="state">
          <el-input v-model="form.state" placeholder="请输入状态0有效1失效" />
        </el-form-item>
        <el-form-item label="是否删除0否1是" prop="dr">
          <el-input v-model="form.dr" placeholder="请输入是否删除0否1是" />
        </el-form-item>-->
<!--        <el-form-item label="审核备注" prop="approvalNote">
          <el-input v-model="form.approvalNote" placeholder="请输入审核备注" />
        </el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 审核 -->
<!--    <el-dialog title="楼宇审核" :visible.sync="buildingAudit" close-on-click-modal center width="500px">
      <el-form :model="form" label-width="80px" >
        <el-form-item label="审核备注" prop="approvalNote">
          <Editor v-model="form.approvalNote" :min-height="100"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="success" @click="submitCheck(1)">审核通过</el-button>
        <span style="width: 5%;display: inline-block"></span>
        <el-button type="danger" @click="submitCheck(2)">审核驳回</el-button>
        <span style="width: 5%;display: inline-block"></span>
        <el-button type="info" @click="cancel">取 消</el-button>
      </div>
    </el-dialog>-->
  </div>
</template>

<script>
import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding } from "@/api/myIndustry/building";
import {listCity} from "@/api/business/businessIntro";
import {parkList, updatePark} from "@/api/myIndustry/park";
import VideoUpload from "@/components/VideoUpload";
import MyEditor from "@/components/wangEdiot";

export default {
  name: "Building",
  components: {MyEditor, VideoUpload},
  dicts: ['floor_height', 'recommend','regional_position','rental_price','selling_price','sys_whether', 'sys_have_not', 'park_apartment', 'space_type', 'economic_belt', 'park_type', 'heating_system', 'degree_of_decoration', 'need_mode', 'refrigerating_system', 'gas_system', 'fire_fighting_device', 'water_system', 'audit_status', 'announce_type'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      //省份
      provinces: [],
      //城市
      citys: [],
      //园区列表
      parkList: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      //客梯数量
      otherElevatorPeople: null,
      //货梯数量
      otherElevatorCargo: null,
      //其他燃气
      otherGas: null,
      // 总条数
      total: 0,
      // 楼宇商用表格数据
      buildingList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      buildingAudit:false,
      acreage: 0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        buildType: 2,
        buildName: null,
        supplyType: null,
        buildLeasePrice: null,
        buildSellPrice: null,
        buildAllSize: null,
        buildFreeSize: null,
        buildNumber: null,
        buildRenova: null,
        buildFloorHeight: null,
        buildPlaceFloor: null,
        buildFirstLoad: null,
        buildLoad: null,
        buildElevatorPeople: null,
        buildElevatorPeopleLoad: null,
        buildElevatorCargo: null,
        buildElevatorCargoLoad: null,
        buildFireControl: null,
        buildEmergency: null,
        buildHeating: null,
        buildRefrig: null,
        buildNather: null,
        buildPower: null,
        buildGas: null,
        buildWater: null,
        buildApartment: null,
        approvalState: null,
        letRequire: null,
        parkType: null,
        parkAreaAddress: null,
        parkDistrict: null,
        parkCarlot: null,
        parkIndustry: null,
        buildFurniture: null,
        parkLogistics: null,
        parkRestaurant: null,
        parkBus: null,
        parkMetro: null,
        buildNeedSize: null,
        approvalNote: null,
        parkId: null,
        provinceId:null,
        cityId: null,
        releaseType: 1,
        pageView: null,
        collectState: null,
        recState: null,
        reserveState: null,
        vrResource: null,
        recomState: null,
        imgResource: null,
        coverResource: null,
        qrCode:null,
        contactName: null,
        servicePhone: null,
        contactPhone: null,
        supplyUserId: null,
        note: null,
        sort: null,
        state: null,
        dr: null,
        vrcover: null,
        top: null,
        buildIntro: null,
        buildAround: null,
        parkLongitude: null,
        parkLatitude: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        releaseType: [
          { required: true, message: "发布类型不能为空", trigger: "blur" }
        ],
        buildName: [
          { required: true, message: "楼宇名称不能为空", trigger: "blur" }
        ],
        contactName: [
          {required: true, message: "联系人不能为空", trigger: "blur"}
        ],
        contactPhone: [
          {required: true, message: "联系方式不能为空", trigger: "blur"},
          {
            required: true,
            pattern: /^[1][3,4,5,7,8,9][0-9]{9}$/,
            message: '请输入正确的手机号码',
            trigger: 'blur',
          },
        ],
        // supplyType: [
        //   {required: true, message: "供给类型不能为空", trigger: "blur"}
        // ],
        // buildAllSize: [
        //   {required: true, message: "建筑总面积不能为空", trigger: "blur"}
        // ],
        cityId: [
          {required: true, message: "所属城市不能为空", trigger: "blur"}
        ],
        // buildIntro: [
        //   {required: true, message: "楼宇介绍不能为空", trigger: "blur"}
        // ],
        // coverResource: [
        //   {required: true, message: "封面资源不能为空", trigger: "blur"}
        // ],
        // imgResource: [
        //   {required: true, message: "图片资源不能为空", trigger: "blur"}
        // ],
        // servicePhone: [
        //   {required: true, message: "联系方式不能为空", trigger: "blur"}
        // ],
        // parkId: [
        //   {required: true, message: "关联园区不能为空", trigger: "blur"}
        // ],
      }
    };
  },
  created() {
    this.getList();
    this.getprovinceList();
  },
  methods: {
    //预览
    handleLook(row) {
      //http://120.46.220.152/#/pages/index/details?id=339&buildType=4&spaceId=dc46adbfb2944da39078f61446cd662f&provinceId=34
      // window.location.href=`http://120.46.220.152/#/pages/news/details?id=`+id
      open(`http://120.46.220.152/#/pages/index/details?id=`+row.id+`&buildType=2&spaceId=` + row.serialNumber + `&provinceId=` + row.provinceId)
    },
    //面积
    handleAcreage(){
      if (this.form.buildAllSize!=null&&this.form.buildFreeSize!=null){
        this.acreage = this.form.buildAllSize-this.form.buildFreeSize
      }
    },
    /** 查询楼宇商用列表 */
    getList() {
      this.loading = true;
      listBuilding(this.queryParams).then(response => {
        this.buildingList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.buildingAudit = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.otherElevatorPeople=null;
      this.otherElevatorCargo=null;
      this.otherGas=null;
      this.form = {
        id: null,
        buildType: 2,
        buildName: null,
        supplyType: [],
        buildLeasePrice: null,
        buildSellPrice: null,
        buildAllSize: null,
        buildFreeSize: null,
        buildNumber: null,
        buildRenova: null,
        buildFloorHeight: null,
        buildPlaceFloor: null,
        buildFirstLoad: null,
        buildLoad: null,
        buildElevatorPeople: null,
        buildElevatorPeopleLoad: null,
        buildElevatorCargo: null,
        buildElevatorCargoLoad: null,
        buildFireControl: [],
        buildEmergency: null,
        buildHeating: null,
        heatingRate:null,
        buildRefrig: null,
        refrigRate: null,
        buildNather: null,
        buildPower: null,
        powerRate: null,
        buildGas: null,
        gasRate: null,
        propertyFee: null,
        buildWater: null,
        waterRate: null,
        buildApartment: [],
        approvalState: null,
        letRequire: null,
        parkType: null,
        parkAreaAddress: null,
        parkDistrict: null,
        parkCarlot: null,
        parkIndustry: null,
        buildFurniture: null,
        parkLogistics: null,
        parkRestaurant: null,
        parkBus: null,
        parkMetro: null,
        buildNeedSize: null,
        approvalNote: null,
        parkId: null,
        cityId: null,
        provinceId:null,
        releaseType: 1,
        pageView: null,
        collectState: null,
        recState: null,
        reserveState: null,
        vrResource: null,
        recomState: null,
        imgResource: null,
        coverResource: null,
        qrCode:null,
        contactName: null,
        servicePhone: null,
        contactPhone: null,
        supplyUserId: null,
        note: null,
        sort: null,
        state: null,
        dr: null,
        createTime: null,
        updateTime: null,
        vrcover: null,
        top: null,
        buildIntro: null,
        buildAround: null,
        parkLongitude: null,
        parkLatitude: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.queryParams.provinceId=null;
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      if (this.$store.getters.checkState==='0'){
        this.$message({
          type: 'info',
          message: `用户信息审核中`
        });
        return
      }else if (this.$store.getters.checkState==='2'){
        this.$message({
          type: 'error',
          message: `用户信息审核失败`
        });
        return
      }else if (this.$store.getters.checkState=== '-1'){
        this.$message({
          type: 'info',
          message: `用户信息未提交`
        });
        return
      }
      this.reset();
      this.getparkList();
      this.open = true;
      this.title = "添加楼宇商用";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      this.getparkList();
      getBuilding(id).then(res => {
        this.form = res.data;
        if (this.form.supplyType != null) {
          this.form.supplyType = this.form.supplyType.split(",");
        }

        if (this.form.buildFireControl != null) {
          this.form.buildFireControl = this.form.buildFireControl.split(",");
        }

        if (this.form.buildApartment != null) {
          this.form.buildApartment = this.form.buildApartment.split(",");
        }

        if (res.data.buildElevatorPeople!=null&&res.data.buildElevatorPeople.indexOf("有-")!==-1){
          this.otherElevatorPeople = res.data.buildElevatorPeople
          this.otherElevatorPeople = this.otherElevatorPeople.substring(this.otherElevatorPeople.indexOf("有-")+2)
          this.form.buildElevatorPeople = this.form.buildElevatorPeople.substring(0,this.form.buildElevatorPeople.indexOf("有-")+2)
        }
        if (res.data.buildElevatorCargo!=null&&res.data.buildElevatorCargo.indexOf("有-")!==-1){
          this.otherElevatorCargo = res.data.buildElevatorCargo
          this.otherElevatorCargo = this.otherElevatorCargo.substring(this.otherElevatorCargo.indexOf("有-")+2)
          this.form.buildElevatorCargo = this.form.buildElevatorCargo.substring(0,this.form.buildElevatorCargo.indexOf("有-")+2)
        }
        if (res.data.parkGas!=null&&res.data.parkGas.includes("其他-")){
          this.otherGas=res.data.parkGas
          this.form.parkGas=this.form.parkGas.substring(0,res.data.parkGas.indexOf("其他-")+3);
          this.otherGas=this.otherGas.substring(res.data.otherGas.indexOf("其他-")+3);
        }
        if (res.data.provinceId!=null&&res.data.provinceId!==''){
          listCity(res.data.provinceId).then(rest =>{
            this.citys = rest.data;
          })
        }
        this.open = true;
        this.title = "修改楼宇商用";
      });
    },
    /** 审核 */
    spaceAudit(row){
      this.reset();
      this.form.id = row.id
      this.buildingAudit = true;
    },
    /** 提交审核 */
    submitCheck(state) {
      updateBuilding({
        id: this.form.id,
        approvalState: state,
        approvalNote: this.form.approvalNote
      }).then(response => {
        this.$modal.msgSuccess("审核成功");
        this.buildingAudit = false;
        this.getList();
      });
    },
    /** 提交按钮 */
    submitForm() {
      if (this.acreage<0){
        this.$alert('还有未处理的警告，请处理完相关问题后提交', '警告', {
          confirmButtonText: '确定',
          callback: action => {
            this.$message({
              type: 'info',
              message: `处理完相关问题后再提交`
            });
          }
        })
        return
      }
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.buildElevatorPeople === "有-" && (this.otherElevatorPeople == null||this.otherElevatorPeople==='')) {
            this.$modal.msgError("请输入客梯数量");
            return;
          }
          if (this.form.buildElevatorCargo === "有-" && (this.otherElevatorCargo == null||this.otherElevatorCargo==='')) {
            this.$modal.msgError("请输入货梯数量");
            return;
          }
          if (this.form.parkGas === "其他-" && (this.otherGas == null||this.otherGas==='')) {
            this.$modal.msgError("请输入其他燃气种类");
            return;
          }
          this.form.supplyType = this.form.supplyType.join(",");
          this.form.buildFireControl = this.form.buildFireControl.join(",");
          this.form.buildApartment = this.form.buildApartment.join(",");

          if (this.form.buildElevatorPeople==="有-"){
            this.form.buildElevatorPeople = this.form.buildElevatorPeople + this.otherElevatorPeople
          }
          if (this.form.buildElevatorCargo==="有-"){
            this.form.buildElevatorCargo = this.form.buildElevatorCargo + this.otherElevatorCargo
          }
          if (this.form.parkGas==="其他-"){
            this.form.parkGas=this.form.parkGas+this.otherGas
          }
          // this.form.approvalState = 0
          if (this.form.id != null) {
            updateBuilding(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBuilding(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除楼宇商用编号为"' + ids + '"的数据项？').then(function() {
        return delBuilding(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('industry/frontend/building/export?buildType=0', {
        ...this.queryParams
      }, `building_${new Date().getTime()}.xlsx`)
    },
    /** 查询省份列表*/
    getprovinceList(){
      var parentId = 0;
      listCity(parentId).then(res =>{
        // console.log("AAA",res)
        this.provinces = res.data;
      })
    },
    //查询市列表
    getCityList(provinceId) {
      // console.log("BBB",provinceId)
      listCity(provinceId).then(res =>{
        this.citys = res.data;
      })
      this.queryParams.cityId=null;
      this.form.cityId = null;
      this.form.areaId = null;
    },
    //获取园区id
    getparkList(){
      parkList().then(res=>{
        // console.log(res)
        this.parkList = res.data;
      })
    }
  }
};
</script>
<style scoped>
.sq {
  width: 25px;
  margin: 0 10px;
  border: none;
  border-bottom: 1px solid;
}
/*.el-form-item {*/
/*  width: 613px;*/
/*}*/
</style>
